<script language="JavaScript" type="text/javascript">
<!--
function viewdiv(name)
{
var e=document.getElementById(name)
e.style.display=(e.style.display=="none")?"":"none";
}
//-->
</script>
<h1>Add A new Paper</h1>

<div id="addpaper" class="PaperShelf-form">

  <%= error_messages_for 'paper' %>
   
  <fieldset>
     <%= form_tag({:action => 'add_paper'},:name=>'paper',:multipart => true) %> 
    <legend>Upload Paper</legend>

      <p>
        <label for="title">*Title:</label>
        <%= text_field :paper,:title, :size => 60 %>
      </p>
         <p>
        <label for="paper_category_id">Category:</label>
        <%= select ("paper", "paper_category_id",PaperCategory.find(:all).collect {|p| [ p.catagory, p.id ] }, { :include_blank => true })%>
      </p>

      <p>
        <label for="author">Author:</label>
        <%= text_field :paper,:author1, :size => 15 %>
        <%= text_field :paper,:author2, :size => 15 %>
        <%= text_field :paper,:author3, :size => 15 %>
        <input id="more_au_ch" name="more_au_ch"  type="checkbox" value="checkbox" onClick="viewdiv('moreauthor')" />
        <lable style="">more</lable>
      </p>
      <div id="moreauthor" style="display:none">
        <p>
            <label>&nbsp;</label>
            <%= text_field :paper,:author4, :size => 15 %>
           <%= text_field :paper,:author5, :size => 15 %>
      </p>
      </div>
      <p>
        <label for="publisher">Publisher:</label>
        <%= text_field :paper,:publisher, :size => 40 %>
        </p>
         <p>
        <label for="publish_time">Publish Time:</label>
       <%= date_select :paper, :publish_time, :start_year => 1910 %>

      </p>

      <p>
        <label for="ISBN">ISBN:</label>
        <%= text_field :paper,:ISBN, :size => 40 %>
        </p>
         <p>
         <label for="page_info">Page:</label>
        <%= text_field :paper,:page_info, :size => 40 %>
      </p>

      <p>
        <label for="keyword1">Keywords:</label>
        <%= text_field :paper,:keyword1, :size => 12 %>
        <%= text_field :paper, :keyword2, :size => 12 %>
        <%= text_field :paper,:keyword3, :size => 12 %>
        <input id="advshow" name="advshow"  type="checkbox" value="checkbox" onClick="viewdiv('adv')" />
        <lable style="">more</lable>
        </p>
        <span id="adv"  style="display:none">
        <p>
        <label>&nbsp;</label>
        <%= text_field :paper,:keyword4,:size=>12 %>
        <%= text_field :paper,:keyword5,:size=>12%>
        <%= text_field :paper,:keyword6,:size=>12%>
        </p>
      </span>
      <p>
        <label for="download_url">Original URL:</label>
        <%= text_field :paper,:download_url, :size => 40 %>
      </p>

      <p>
        <label for="abstract">Abstract:</label><br/>
        <%= text_area :paper,:abstract ,:rows=>12 ,:cols=>40 %>
      </p>
      <p>
        <label for="summary">Summary:</label><br/>
        <%= text_area :paper,:uploader_summary ,:rows=>12 ,:cols=>40 %>
      </p>

        
<p>
      <label >Upload your OriginalFile</label><br/>
            <%= file_field("originalfile", "file") %> 
        </p>

<p>
      <label >Upload your Translation</label><br/>
            <%= file_field("transfile", "file") %> 
        </p>
  
  
<p>  <label >Upload your PPT</label><br/>
     <%= file_field("pptfile", "file") %> 
</p>
<%= submit_tag "Upload", :class => "submit", :disable_with => "文件上传中..." %>
<%= end_form_tag %>   
     </fieldset>
 
</div>
